function http(url,method,callBack){
		var that=this;
		uni.request({
			url:url, 
			method:method,
			data: {
			},
			header: {
				'content-type': 'json' //自定义请求头信息
			},
			success: function(res) {
				callBack(res.data)
			},
			fail: function(err) {
				console.log(err)
			}
		});
	};
	
function converToCastString(casts){
	var castsjoin="";
	for(var idx in casts){
		castsjoin=castsjoin+casts[idx].name+"/";
	};
	return castsjoin.substring(0,castsjoin.length-2);
};

function converToCastInfos(casts){
	var castsArray=[];
	for(var idx in casts){
		var cast={
			img:casts[idx].avatars?casts[idx].avatars.large:"",
			name:casts[idx].name
		}
		castsArray.push(cast);
	};
	return castsArray;
};

function PullToRefresh(e){
	var pullDate={
		top:0,
		startyY:0,
		touching:false
	};
	function craetWarp(e){
		//先在下拉元素上创建个盒子
		
	};
	function touchStart(e){//触摸开始的时候触发
		pullDate.startyY=e.targetTouches[0].pageY;
		pullDate.touching=true;	
		console.log(e.offsetTop);
	};
	function touchMove(e){//手指在屏幕上滑动的时候触发
	};
	function toucHend(){//触摸结束的时候触发
		
	};
};	



module.exports={
	http,
	converToCastString,
	converToCastInfos
}